package com.example.sellersale.server.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.sellersale.entity.User;
import com.example.sellersale.mapper.UserMapper;
import com.example.sellersale.server.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {
    @Autowired
    private UserMapper userMapper;



    //用户登录
    public User login(User user){
       return userMapper.isLogin(user);
    }
    //用户注册
    public User register(User user){
        int insert = userMapper.insert(user);
        return insert==1?user:null;
    }



    //获取所有的用户信息
    public List<User> allUser(){
        List<User> users = userMapper.allUser();
        return users;
    }


}
